//接口：是一种能力一种约束
(()=>{
    interface IPerson{
        firstName:string//姓氏
        lastName:string// 名字
    }
    //定义一个类型
    class Person{
        //定义公共的字段（属性）
        firstName :string
        lastName:string
        fullName:string
        //定义一个构造器函数
        constructor(firstName:string,lastName:string){
            //更新属性数据
            this.firstName = firstName
            this.lastName= lastName
            this.fullName= this.fullName+'-'+this.lastName
        }
    }
    //定义函数
    function showFullName(person:IPerson){
        return person.firstName + '-' + person.lastName
    }
    //实例话对象
    const person = new Person('诸葛','孔明')
    console.log(showFullName(person));
})()